import cv2

# 打印 OpenCV 版本
print("opencv-python version:", cv2.__version__)

# 读取图像
img = cv2.imread("../LingXiao.png", -1)

# 检查图像是否成功读取
if img is None:
    print("Error: Image not found or unable to open the image.")
else:
    # 显示图像
    cv2.imshow("LingXiao", img)
    
    # 等待ESC按键并关闭窗口
    key = 0
    while(key != 27): 
        key = cv2.waitKey()
        print("key:{}".format(key))
    cv2.destroyAllWindows()
